import { getDictList } from '@/api/system/dict.data'
import { getDictTypeList } from '@/api/system/dict.type'
export async function getDict(obj) {
  const typeList = await getDictTypeList({ searchForm: {}})
  const dictList = await getDictList({ searchForm: {}})
  typeList.data.listLine.forEach(key => {
    obj[key.dictType] = { name: key.dictTypeName, dict: [] }
    obj[key.dictType].dict = dictList.data.listLine.filter((item) => {
      return item.dictType === key.dictType
    }).map((item) => {
      return { id: String(item.dictId), name: item.dictName }
    })
  })
}

